{extend name="public/base" /}

{block name="css_new"}


<title>我的奖扣</title>{/block}

{block name="pjax_container"}

<section class="content-header">
    <h1>扣分任务详情</h1>
    <ol class="breadcrumb">
        <li>奖扣任务</li>
        <li>我的奖扣</li>
        <li class="active"><i class="fa fa-dashboard"></i>扣分任务详情</li>
    </ol>
</section>

<style>
    .content {
        padding: 15px 2% !important;
    }

    .integral-bar {
        height: 480px;
        margin-top: 30px;
        background-color: #fff;
    }

    .integral-bar .integrl-title {
        height: 80px;
        border-bottom: 1px solid #ccc;
        width: 95%;
        line-height: 80px;
        font-size: 16px;
        margin: 0 auto;
    }

    .integral-bar .integrl-title .integrl-rigth {
        width: 131px;
        height: 80px;
        float: right;
    }

    .integral-bar .integrl-title .integrl-left {
        width: 410px;
        height: 80px;
        float: left;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-pack: distribute;
        justify-content: space-around;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
    }

    .integral-bar .integrl-title .integrl-left > a {
        display: inline-block;
        width: 62px;
        height: 30px;
        border-radius: 5px;
        border: 1px solid #1890FF;
        line-height: 30px;
        text-align: center;
        font-size: 14px;
        color: #666;
    }

    .integral-bar .integrl-title .integrl-left .tabs {
        width: 150px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        height: 32px;
        border-radius: 5px;
        line-height: 32px;
        text-align: center;
    }

    .integral-bar .integrl-title .integrl-left .tabs .active {
        border: 1px solid #1890FF !important;
    }

    .integral-bar .integrl-title .integrl-left .tabs > div {
        cursor: pointer;
        font-size: 14px;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        border: 1px solid #ccc;
    }

    .integral-bar .integrl-title .integrl-left .tabs > div:nth-child(1) {
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        border-right: none;
    }

    .integral-bar .integrl-title .integrl-left .tabs > div:nth-child(2) {
        border-right: none;
    }

    .integral-bar .integrl-title .integrl-left .tabs > div:nth-child(3) {
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
    }

    .integral-bar .integrl-title .integrl-left #date {
        width: 160px;
        height: 32px;
        border-radius: 5px;
    }

    .integral-bar .integrl-body {
        width: 95%;
        overflow: hidden;
        margin: 0px auto;
    }

    .integral-bar .integrl-body .integrl-list {
        width: 100%;
        height: 100%;
    }

    .integral-bar .integrl-body > h3 {
        float: left;
        font-size: 14px;
    }

    .integral-bar .integrl-body > div {
        float: right;
    }

    .integral-table {
        width: 100%;
        background-color: #fff;
        padding-top: 60px;
    }

    .integral-table .integral-bottom-title {
        height: 45px;
        background-color: #e6f7ff;
        border-radius: 5px;
        width: 95%;
        margin: 0 auto;
        line-height: 45px;
        padding-left: 30px;
        color: #282828;
        letter-spacing: .5px;
        border: 1px solid #1890FF;
    }

    .integral-table .table {
        width: 95%;
        color: rgba(0, 0, 0, 0.65);
        margin: 15px auto;
    }

    .integral-table .table td {
        padding: 16px 16px 16px 5px;
        word-break: break-all;
    }

    .table-paging {
        height: 100px;
        width: 100%;
        position: relative;
        background-color: #fff;
    }

    .table-paging .layui-box {
        position: absolute;
        right: 10px;
        top: 50%;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
    }

    /*# sourceMappingURL=indexInfo.css.map */
</style>

<section class="content" onload="opener.location.reload()">

    <div class="box box-primary">
    </div>

    <div class="integral-bar">
        <div class="integrl-title">
            <div class="integrl-left">
                <a href="{:url('index',['uid'=>input('uid',0)])}">返回</a>
                <div class="tabs">
                    <div class="active"><a href="{:url('buckle_info',['type'=>1,'uid'=>input('uid',0)])}">月份</a></div>
                    <div data-type="2"><a href="{:url('buckle_info',['type'=>2,'uid'=>input('uid',0)])}">周</a></div>
                    <div data-type="3"><a href="{:url('buckle_info',['type'=>3,'uid'=>input('uid',0)])}">天</a></div>
                </div>
                <input type="text" class="layui-input" id="date"/>
            </div>
            <div class="integrl-rigth">扣分任务 (<span>
               {if condition="input('type',1) == 1"}
                月
                {elseif condition="input('type',1) == 2"}
                周
                {else:}
                天
                {/if}
            </span>)</div>
        </div>
        <div class="integrl-body">
            <h3><b>{$users.name}</b>（<b>{$users.department_name}</b> / <b>{$users.job_number}</b>）</h3>
            <div style="height: 80px;line-height: 80px; letter-spacing: .5px;"><b>{:date('m',time())}</b>月奖扣情况扣分:<span
                    style="margin-left: 5px">{$month_data.sum}</span></div>
            <div class="swiper-wrapper">
                <div class="swiper-slide">
                    <div class="integrl-list">
                        <div id="chart" style="width: 100%;height:350px;margin-top:-30px;"></div>
                    </div>

                </div>
                <div class="swiper-slide">
                    <div class="integrl-list">

                        <div id="chart2" style="width: 100%;height:350px; margin-top:-30px;"></div>
                    </div>

                </div>
                <div class="swiper-slide">
                    <div class="integrl-list">

                        <div id="char3" style="width: 100%;height:350px; margin-top:-30px;"></div>
                    </div>

                </div>
            </div>

        </div>
    </div>

    <div class="integral-table">
        <div class="integral-bottom-title">
            <b id="month_time">{:date('m',time())}月份</b>扣分明细
        </div>
        <table class="table table-hover">
            <thead>
            <tr>
                <th scope="col">奖扣对象</th>
                <th scope="col">奖扣时间</th>
                <th scope="col">事件名称</th>
                <th scope="col">B分</th>
                <th scope="col">记录人</th>
                <th scope="col">初审人</th>
                <th scope="col">终审人</th>
                <th scope="col">审核状态</th>
            </tr>
            </thead>
            <tbody id="prize_data">
            {volist name="$month_data.list" id="vo"}
            <tr>
                <td>{$vo.name}</td>
                <td>{$vo.prize_buckle_time}</td>
                <td>{$vo.event_name}</td>
                <td>{$vo.integral_b}</td>
                <td>{$vo.record_name}</td>
                <td>{$vo.first_name}</td>
                <td>{$vo.last_name}</td>
                <td>审核通过</td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="table-paging" id="paging">
        </div>
    </div>
</section>
<script>

    $(function () {


        // 列表部分 全选
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        $('.checkbox-toggle').on('ifChecked', function (event) {
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("check");
        });
        $('.checkbox-toggle').on('ifUnchecked', function (event) {
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("uncheck");
        });


    });
    var myChart = echarts.init(document.getElementById('chart'));
    var myChart2 = echarts.init(document.getElementById('chart2'));
    var myChart3 = echarts.init(document.getElementById('char3'));

    option = {
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            },
            formatter: function(params) {
                var aa = {:json_encode($data)};
                var dataIndex = params[0].dataIndex;
                var str = "";
                var task = aa[dataIndex].integral_reward;
                for(let i = 0; i < params.length; i++) {
                    str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[i].color + '"></span>' + params[i].seriesName + ' : ' + params[i].data + '' + '<br/>'
                    str2 = params[i].name + '<br/>' + str;
                }

                return str2 + '任务目标: '+task+'<br/>';
            }
        },
        //  yAxis: {
        //     show: false,
        //     axisLine: {
        //         show: false,
        //     }
        // },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', "8月", "9月", "10月", "11月", "12月"],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {

                type: 'value'
            }
        ],
        series: [
            {
                name: '实际扣分',
                type: 'bar',
                barWidth: '50%',
                itemStyle: {
                    normal: {
                        color: "#FF8D8D"
                    }
                },
                data: [
                    {volist name = '$data' id = 'vo'}
                    {$vo.prize},
                    {/volist}
                ]
    }

    ]
    }
    ;
    option2 = {
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            },
            formatter: function(params) {
                var aa = {:json_encode($data)};
                var dataIndex = params[0].dataIndex;
                var str = "";
                var task = aa[dataIndex].integral_reward;
                for(let i = 0; i < params.length; i++) {
                    str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[i].color + '"></span>' + params[i].seriesName + ' : ' + params[i].data + '' + '<br/>'
                    str2 = params[i].name + '<br/>' + str;
                }

                return str2 + '任务目标: '+task+'<br/>';
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['第一周', '第二周', '第三周', '第四周'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '实际扣分',
                type: 'bar',
                itemStyle: {
                    normal: {
                        color: "#FF8D8D"
                    }
                },
                data: [
                    {volist name = '$data' id = 'vo'}
                    {$vo.prize},
                    {/volist}
                ]
    }

    ]
    }
    ;
    option3 = {
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            },
            formatter: function(params) {
                var aa = {:json_encode($data)};
                var dataIndex = params[0].dataIndex;
                var str = "";
                var task = aa[dataIndex].integral_reward;
                for(let i = 0; i < params.length; i++) {
                    str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[i].color + '"></span>' + params[i].seriesName + ' : ' + params[i].data + '' + '<br/>'
                    str2 = params[i].name + '<br/>' + str;
                }
                return str2 + '任务目标: '+task+'<br/>';
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ["1日", "2日", "3日", "4日", "5日", "6日", "7日", "8日", "9日", "10日", "11日", "12日", "13日", "14日", "15日", "16日", "17日", "18日"
                    , "19日", "20日", "21日", "22日", "23日", "24日", "25日", "26日", "27日", "28日", "29日", "30日", "31日"],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '实际扣分',
                type: 'bar',
                barWidth: '50%',
                itemStyle: {
                    normal: {
                        color: "#FF8D8D"
                    }
                },
                data: [
                    {volist name = '$data' id = 'vo'}
                    {$vo.prize},
                    {/volist}
                ]
    }

    ]
    }
    ;


    myChart.setOption(option);
    myChart2.setOption(option2);
    myChart3.setOption(option3);
    var page = layui.use(['laypage', 'layer'], function () {
        var laypage = layui.laypage
            , layer = layui.layer;

        //总页数低于页码总数
        laypage.render({
            elem: 'demo0'
            , count: {$month_data.count} //数据总数
        });


        //完整功能
        laypage.render({
            elem: 'paging'
            , count: {$month_data.count}
            ,limit:10
            , theme: '#1890FF'
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
            , jump: function (obj,first) {
                if(!first) {
                    var type = "{:input('type',1)}";
                    var time = $('#date').val();
                    var number = "{:date('m',time())}";
                    var limit = obj.limit;
                    var page = obj.curr;
                    var uid = "{:input('uid',0)}";
                    $.ajax({
                        url: "{:url('buckle_info_api')}",
                        data: {type: type, time: time, number: number,page_limit:limit,page:page,uid:uid},
                        type: 'post',
                        success: function (data) {
                            if (data.code == 0) {
                                data = data.data;
                                // console.log(data);
                                //删除元素
                                $('#prize_data').empty();
                                //新增元素
                                var html = '';
                                for (i = 0; i < data.list.length; i++) {
                                    html += '<tr>\n' +
                                        '                <td>' + data.list[i].name + '</td>\n' +
                                        '                <td>' + data.list[i].prize_buckle_time + '</td>\n' +
                                        '                <td>' + data.list[i].event_name + '</td>\n' +
                                        '                <td>' + data.list[i].integral_b + '</td>\n' +
                                        '                <td>' + data.list[i].record_name + '</td>\n' +
                                        '                <td>' + data.list[i].first_name + '</td>\n' +
                                        '                <td>' + data.list[i].last_name + '</td>\n' +
                                        '                <td>审核通过</td>\n' +
                                        '            </tr>';
                                }
                                $('#prize_data').append(html);
                            }
                        }
                    });
                }
            }
        });


    });


    var tabs = new Swiper('.integrl-body', {
        speed: 1000,
        on: {
            slideChangeTransitionStart: function () {
                $('.integrl-title .tabs .active').removeClass('active');
                $('.integrl-title .tabs div').eq(this.activeIndex).addClass('active');
            }
        }
    })
    var index = "{:input('type',1)}" -1;
    console.log(index);
    tabs.slideTo(index);
    myChart.on('click',function(params){
        var type = index + 1;
        var time = $('#date').val();
        var number = params.dataIndex + 1;
        var uid = "{:input('uid',0)}";
        $.ajax({
            url:"{:url('buckle_info_api')}",
            data:{type:type,time:time,number:number,uid:uid},
            type:'post',
            success:function (data) {
                if(data.code == 0){
                    data = data.data;
                    // console.log(data);
                    //删除元素
                    $('#prize_data').empty();
                    //新增元素
                    var html = '';
                    for(i = 0;i<data.list.length;i++){
                        html+='<tr>\n' +
                            '                <td>'+data.list[i].name+'</td>\n' +
                            '                <td>'+data.list[i].prize_buckle_time+'</td>\n' +
                            '                <td>'+data.list[i].event_name+'</td>\n' +
                            '                <td>'+data.list[i].integral_b+'</td>\n' +
                            '                <td>'+data.list[i].record_name+'</td>\n' +
                            '                <td>'+data.list[i].first_name+'</td>\n' +
                            '                <td>'+data.list[i].last_name+'</td>\n' +
                            '                <td>审核通过</td>\n' +
                            '            </tr>';
                    }
                    $('#prize_data').append(html);
                    //更新月份显示
                    if(type == 1){
                        var aa = '月份';
                    }else if(type == 2){
                        var aa = '周';
                    }else if(type == 3){
                        var aa = '日';
                    }
                    var month_time = number+aa;
                    console.log(month_time);
                    $('#month_time').html(month_time);
                    //新增分页显示
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage
                            , layer = layui.layer;

                        //总页数低于页码总数
                        laypage.render({
                            elem: 'demo0'
                            , count: data.count //数据总数
                        });
                        //完整功能
                        laypage.render({
                            elem: 'paging'
                            , count: data.count
                            ,limit:data.page_limit
                            , theme: '#1890FF'
                            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                            , jump: function (obj,first) {
                                if(!first){
                                    console.log(obj);
                                    var type = index + 1;
                                    var time = $('#date').val();
                                    var number = params.dataIndex + 1;
                                    var limit = obj.limit;
                                    var page = obj.curr;
                                    var uid = "{:input('uid',0)}";
                                    $.ajax({
                                        url: "{:url('buckle_info_api')}",
                                        data: {type: type, time: time, number: number,page_limit:limit,page:page,uid:uid},
                                        type: 'post',
                                        success: function (data) {
                                            if (data.code == 0) {
                                                data = data.data;
                                                // console.log(data);
                                                //删除元素
                                                $('#prize_data').empty();
                                                //新增元素
                                                var html = '';
                                                for (i = 0; i < data.list.length; i++) {
                                                    html += '<tr>\n' +
                                                        '                <td>' + data.list[i].name + '</td>\n' +
                                                        '                <td>' + data.list[i].prize_buckle_time + '</td>\n' +
                                                        '                <td>' + data.list[i].event_name + '</td>\n' +
                                                        '                <td>' + data.list[i].integral_b + '</td>\n' +
                                                        '                <td>' + data.list[i].record_name + '</td>\n' +
                                                        '                <td>' + data.list[i].first_name + '</td>\n' +
                                                        '                <td>' + data.list[i].last_name + '</td>\n' +
                                                        '                <td>审核通过</td>\n' +
                                                        '            </tr>';
                                                }
                                                $('#prize_data').append(html);
                                            }
                                        }
                                    });
                                }
                            }
                        });


                    });
                }
            }
        });
    });
    myChart2.on('click',function(params){
        var type = index + 1;
        var time = $('#date').val();
        var number = params.dataIndex + 1;
        var uid = "{:input('uid',0)}";
        $.ajax({
            url:"{:url('buckle_info_api')}",
            data:{type:type,time:time,number:number,uid:uid},
            type:'post',
            success:function (data) {
                if(data.code == 0){
                    data = data.data;
                    // console.log(data);
                    //删除元素
                    $('#prize_data').empty();
                    //新增元素
                    var html = '';
                    for(i = 0;i<data.list.length;i++){
                        html+='<tr>\n' +
                            '                <td>'+data.list[i].name+'</td>\n' +
                            '                <td>'+data.list[i].prize_buckle_time+'</td>\n' +
                            '                <td>'+data.list[i].event_name+'</td>\n' +
                            '                <td>'+data.list[i].integral_b+'</td>\n' +
                            '                <td>'+data.list[i].record_name+'</td>\n' +
                            '                <td>'+data.list[i].first_name+'</td>\n' +
                            '                <td>'+data.list[i].last_name+'</td>\n' +
                            '                <td>审核通过</td>\n' +
                            '            </tr>';
                    }
                    $('#prize_data').append(html);
                    //更新月份显示
                    if(type == 1){
                        var aa = '月份';
                    }else if(type == 2){
                        var aa = '周';
                    }else if(type == 3){
                        var aa = '日';
                    }
                    var month_time = number+aa;
                    console.log(month_time);
                    $('#month_time').html(month_time);
                    //新增分页显示
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage
                            , layer = layui.layer;

                        //总页数低于页码总数
                        laypage.render({
                            elem: 'demo0'
                            , count: data.count //数据总数
                        });
                        //完整功能
                        laypage.render({
                            elem: 'paging'
                            , count: data.count
                            ,limit:data.page_limit
                            , theme: '#1890FF'
                            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                            , jump: function (obj,first) {
                                if(!first){
                                    console.log(obj);
                                    var type = index + 1;
                                    var time = $('#date').val();
                                    var number = params.dataIndex + 1;
                                    var limit = obj.limit;
                                    var page = obj.curr;
                                    var uid = "{:input('uid',0)}";
                                    $.ajax({
                                        url: "{:url('buckle_info_api')}",
                                        data: {type: type, time: time, number: number,page_limit:limit,page:page,uid:uid},
                                        type: 'post',
                                        success: function (data) {
                                            if (data.code == 0) {
                                                data = data.data;
                                                // console.log(data);
                                                //删除元素
                                                $('#prize_data').empty();
                                                //新增元素
                                                var html = '';
                                                for (i = 0; i < data.list.length; i++) {
                                                    html += '<tr>\n' +
                                                        '                <td>' + data.list[i].name + '</td>\n' +
                                                        '                <td>' + data.list[i].prize_buckle_time + '</td>\n' +
                                                        '                <td>' + data.list[i].event_name + '</td>\n' +
                                                        '                <td>' + data.list[i].integral_b + '</td>\n' +
                                                        '                <td>' + data.list[i].record_name + '</td>\n' +
                                                        '                <td>' + data.list[i].first_name + '</td>\n' +
                                                        '                <td>' + data.list[i].last_name + '</td>\n' +
                                                        '                <td>审核通过</td>\n' +
                                                        '            </tr>';
                                                }
                                                $('#prize_data').append(html);
                                            }
                                        }
                                    });
                                }
                            }
                        });


                    });
                }
            }
        });
    });
    myChart3.on('click',function(params){
        var type = index + 1;
        var time = $('#date').val();
        var number = params.dataIndex + 1;
        var uid = "{:input('uid',0)}";
        $.ajax({
            url:"{:url('buckle_info_api')}",
            data:{type:type,time:time,number:number,uid:uid},
            type:'post',
            success:function (data) {
                if(data.code == 0){
                    data = data.data;
                    // console.log(data);
                    //删除元素
                    $('#prize_data').empty();
                    //新增元素
                    var html = '';
                    for(i = 0;i<data.list.length;i++){
                        html+='<tr>\n' +
                            '                <td>'+data.list[i].name+'</td>\n' +
                            '                <td>'+data.list[i].prize_buckle_time+'</td>\n' +
                            '                <td>'+data.list[i].event_name+'</td>\n' +
                            '                <td>'+data.list[i].integral_b+'</td>\n' +
                            '                <td>'+data.list[i].record_name+'</td>\n' +
                            '                <td>'+data.list[i].first_name+'</td>\n' +
                            '                <td>'+data.list[i].last_name+'</td>\n' +
                            '                <td>审核通过</td>\n' +
                            '            </tr>';
                    }
                    $('#prize_data').append(html);
                    //更新月份显示
                    if(type == 1){
                        var aa = '月份';
                    }else if(type == 2){
                        var aa = '周';
                    }else if(type == 3){
                        var aa = '日';
                    }
                    var month_time = number+aa;
                    console.log(month_time);
                    $('#month_time').html(month_time);
                    //新增分页显示
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage
                            , layer = layui.layer;

                        //总页数低于页码总数
                        laypage.render({
                            elem: 'demo0'
                            , count: data.count //数据总数
                        });
                        //完整功能
                        laypage.render({
                            elem: 'paging'
                            , count: data.count
                            ,limit:data.page_limit
                            , theme: '#1890FF'
                            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                            , jump: function (obj,first) {
                                if(!first){
                                    console.log(obj);
                                    var type = index + 1;
                                    var time = $('#date').val();
                                    var number = params.dataIndex + 1;
                                    var limit = obj.limit;
                                    var page = obj.curr;
                                    var uid = "{:input('uid',0)}";
                                    $.ajax({
                                        url: "{:url('buckle_info_api')}",
                                        data: {type: type, time: time, number: number,page_limit:limit,page:page,uid:uid},
                                        type: 'post',
                                        success: function (data) {
                                            if (data.code == 0) {
                                                data = data.data;
                                                // console.log(data);
                                                //删除元素
                                                $('#prize_data').empty();
                                                //新增元素
                                                var html = '';
                                                for (i = 0; i < data.list.length; i++) {
                                                    html += '<tr>\n' +
                                                        '                <td>' + data.list[i].name + '</td>\n' +
                                                        '                <td>' + data.list[i].prize_buckle_time + '</td>\n' +
                                                        '                <td>' + data.list[i].event_name + '</td>\n' +
                                                        '                <td>' + data.list[i].integral_b + '</td>\n' +
                                                        '                <td>' + data.list[i].record_name + '</td>\n' +
                                                        '                <td>' + data.list[i].first_name + '</td>\n' +
                                                        '                <td>' + data.list[i].last_name + '</td>\n' +
                                                        '                <td>审核通过</td>\n' +
                                                        '            </tr>';
                                                }
                                                $('#prize_data').append(html);
                                            }
                                        }
                                    });
                                }
                            }
                        });


                    });
                }
            }
        });
    });

    var now = new Date();
    var yy = now.getFullYear(); //年
    var mm = now.getMonth() + 1; //月
    var dd = now.getDate(); //日
    var hh = now.getHours(); //时
    var ii = now.getMinutes(); //分
    var ss = now.getSeconds(); //秒
    var time = yy + "-";
    if (mm < 10) time += "0";
    time += mm + "-";
    if (dd < 10) time += "0";
    time += dd + " ";
    if (hh < 10) time += "0";
    time += hh + ":";
    if (ii < 10) time += '0';
    time += ii + ":";
    if (ss < 10) time += '0';
    time += ss;


    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var type;
        var uid = "{:input('uid',0)}";
        if(index == 0){
            type = 'year';
            var value_a = "{:input('time',date('Y',time()))}";
        }else{
            var value_a = "{:input('time',date('Y-m',time()))}";
            type = 'month';
        }

        //执行一个laydate实例
        laydate.render({
            elem: '#date',
            value: value_a,
            type: type,
            min: '2008-1-1',
            max: time,
            done: function(value, date){
                var url= "{:url('buckle_info',['type'=>input('type',1)])}"+'/time/'+value+'/uid/'+uid;
                window.location.href=url;
            }

        });
    });


</script>


{/block}
